package com.cskaoyan.gateway.controller.user;

import com.mall.commons.result.ResponseData;
import com.mall.commons.result.ResponseUtil;
import com.mall.user.IUserRegister;
import com.mall.user.annotation.Anoymous;
import com.mall.user.dto.UserVerifyRequest;
import com.mall.user.dto.UserVerifyResponse;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Liang Shunhao
 * @description: 用户邮箱激活
 * @date 2021/9/29 14:36
 */
@RestController
@RequestMapping("user")
public class VerifyController {

    @Reference(timeout = 3000, check = false)
    IUserRegister userRegister;

    /**
     * 用户激活
     */
    @RequestMapping("verify")
    @Anoymous
    public ResponseData verify(UserVerifyRequest userVerifyRequest) {
        UserVerifyResponse verify = userRegister.verify(userVerifyRequest);
        return new ResponseUtil<>().setData("激活成功");
    }
}
